<template>
  <div>
  
<el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>基本信息</span></div>
      <div class="devTitle"><span>{{infoDetail.planName}}</span></div>
      <div>
        <div class="tableStyle">
          <div class="labelS">任务名称</div>
          <div class="contentS">{{infoDetail.planName}}</div>
          <div class="labelS">计划编号</div>
          <div class="contentS">{{infoDetail.planNum}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">创建人</div>
          <div class="contentS">{{infoDetail.createBy}}</div>
          <div class="labelS">创建时间</div>
          <div class="contentS">{{infoDetail.createTime}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">检修类型</div>
          <div class="contentS">{{infoDetail.repairType}}</div>
          <div class="labelS">计划部门</div>
          <div class="contentS">{{infoDetail.deptId}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">计划执行时间</div>
          <div class="contentS">{{infoDetail.planBeginTime}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">备注</div>
          <div class="contentS">{{infoDetail.remark}}</div>
        </div>
      </div>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">计划文件</span>
      </div>
    </el-card>
    <!-- <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">计划备件</span>
      </div>
      <el-table :data="tableData2" border style="width: 100%">
           <el-table-column
         label="序号"
      type="index"
      width="50">
    </el-table-column>
        <el-table-column prop="number" label="备件编号" >
        </el-table-column>
        <el-table-column prop="project" label="设备名称"> </el-table-column>
        <el-table-column prop="time" label="计划数量"> </el-table-column>
      </el-table>
    </el-card> -->
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">检修设备</span>
      </div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="deviceNum" label="设备编号"> </el-table-column>
        <el-table-column prop="deviceName" label="设备名称"> </el-table-column>
        <el-table-column prop="brandName" label="品牌"> </el-table-column>
        <el-table-column prop="category" label="类别" >
        </el-table-column>
        <el-table-column prop="specification" label="规格型号"> </el-table-column>
        <el-table-column prop="location" label="位置" >
        </el-table-column>
        <el-table-column prop="remark" label="备注"> </el-table-column>
      </el-table>
       <div style="text-align:right;margin-top:20px;">
                <el-pagination
  background
  :pager-count="5"
  layout="total,prev, pager, next"
 small
 :page-size="pageSize"
 @current-change="handleCurrentChange"
 :current-page.sync="currentPage"
  :total="total">
</el-pagination>
            </div>
    </el-card>
     
  </div>
</template>
<script>
 import {getObj,getDevAnuthPage} from "@/api/ems/repair/plan";
export default {
  data() {
    return {
      tableData: [],
      
      id:"",
      infoDetail:{},
      currentPage: 1,
      total:0,
      pageSize:5,
    };
  },
   mounted(){
    this.id = this.$route.query.id;
    this.getObjList();
    this.getDevAnuthPage()
  },
  methods:{
    getObjList(){
      getObj(this.id).then((res)=>{
        this.infoDetail = res.data.data
      })
    },
     getDevAnuthPage(){
      getDevAnuthPage({planId: this.id,size:this.pageSize,current:this.currentPage}).then((res)=>{
         this.tableData = res.data.data.records;
            this.total = res.data.data.total;
      })

    },
    handleCurrentChange(index){
        this.currentPage = index;
         this.getDevAnuthPage();
    },
  }
};
</script>
<style lang="scss" scoped>
@import "@/styles/color.scss";
.headerStyle{
   margin-bottom: 20px;
}
.tableTitle {
  color: #333;
  font-size: 16px;
  font-weight: bold;
 margin-bottom: 20px;
 
}
.smallTitle{
  color: rgba(153, 153, 153, 100);
font-size: 12px;
margin-left: 10px;
}
.devTitle {
  color: #262626;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.box-card {
  margin-bottom: 10px;
  .el-card__body {
    padding-top: 10px;
  }
  .labelS {
    //display: inline-block;
    flex:0 0 150px;
    //height: 40px;
    // margin-right: 10px;
    text-align: left;
    color: #606266;
    padding: 10px;
    border: 1px solid rgba(236, 240, 244, 100);
    margin-bottom: -1px;
  }
  .contentS {
    border: 1px solid rgba(236, 240, 244, 100);
    // height: 40px;
    color: #606266;
    width: 100%;
    margin-left: -1px;
    margin-bottom: -1px;
    padding: 10px;
    // margin: 10px 0;
    // width: calc(100% - 120px);
    // display: inline-block;
  }
  .tableStyle {
    display: flex;
  }
  .number{
      font-weight: bold;
      margin-top: 5px;
      font-size: 16px;
  }
  .nocomplate{
      color: white;
      background-color: #E83672;
      padding: 3px 5px;
      border-radius: 3px;
      font-size: 12px;
  }
  .complate{
     background-color: #78BF34;
  }
}

</style>
